package com.code.snippet.wdg;

public class WdgTest {
    public static void main(String[] agrs) {
        WeightedDirectedGraph theGraph=new WeightedDirectedGraph();//创建一个图
        theGraph.addVertex('A');//添加顶点
        theGraph.addVertex('B');//添加顶点
        theGraph.addVertex('C');//添加顶点
        theGraph.addVertex('D');//添加顶点
        theGraph.addVertex('E');//添加顶点

        theGraph.addEdge(0,1,50);//添加边
        theGraph.addEdge(0,3,80);//添加边
        theGraph.addEdge(1,2,60);//添加边
        theGraph.addEdge(1,3,90);//添加边
        theGraph.addEdge(2,4,40);//添加边
        theGraph.addEdge(3,2,20);//添加边
        theGraph.addEdge(3,4,70);//添加边
        theGraph.addEdge(4,1,50);//添加边


        theGraph.path();

    }
}
